﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model;
using Repository;
using WZVTC.SoftDev.DDDFW.Domain.Core;
using WZVTC.SoftDev.DDDFW.EntityServices;
using WZVTC.SoftDev.DDDFW.Domain.Specification;

namespace EntityServices
{
    public class 用户Service:BaseServices<用户>
    {
        public 用户Service(IUnitOfWork _context, 用户Repository _Repository) : base(_context, _Repository) { }


        public 用户 GetById(int id)
        {
            ISpecification<用户> sp = new DirectSpecification<用户>(x => x.Id == id);
            return base.GetByCondition(sp);
        }

        public 用户 GetById(string nm)
        {
            ISpecification<用户> sp = new DirectSpecification<用户>(x => x.昵称 == nm);
            return base.GetByCondition(sp);
        }
    }
}
